/*
    <box>
		<fusion type = "Button" name = "btn" x = "400" y = "300">
			<fragment> LeftLeg </fragment>
			<fragment> RightLeg </fragment>
		</fusion>
		
		<fusion type = "Fusion" name = "fusion" x = "500" y = "300">
			<fragment> LeftLeg </fragment>
			<fragment> RightLeg </fragment>
		</fusion>
	</box>
  */
	
  	
	
	/**
	 * @usage
	 * 
	 * ui
	 * |
	 * |--makeups
	 * |    |--AAAMakeup
	 * |    |--BBBMakeup
	 * |    |--CCCMakeup
	 * |    |--DDDMakeup
	 * |    |--EEEMakeup
	 * |    |....
	 * |
	 * |--states
	 * |    |--aaa
	 * |    |    |--AAAState
	 * |    |    |--makeups
	 * |    |    |    |--???Makeup
	 * |    |    |    |--???Makeup
	 * |    |    |....
	 * |    |--bbb
	 * |    |    |--BBBState
	 * |    |    |--makeups
	 * |    |    |    |--???Makeup
	 * |    |    |    |--???Makeup
	 * |    |    |....
	 * 
	 */
package org.despair2D.ui 
{
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import org.despair2D.debug.Logger;
	import org.despair2D.ui.core.IComponent;
	import org.despair2D.ui.core.UIManager;
	import org.despair2D.ui.puppet.IPuppet;
	import org.despair2D.ui.Persona;
	
	import org.despair2D.core.ns_despair;
	use namespace ns_despair;
	
	
final public class DespairUI
{
	
	/** @Button **/
	Button;
	CheckBox;
	
	ScaleButton;
	LabelButton;
	SectionButton;
	//SectionCheckBox;
	
	/** @Container **/
	Fusion;
	FusionGroup;
	Persona;
	
	/** @Layout **/
	
	/** @Range **/
	FrameRange;
	Spinner
	NumericStepper
	//Slider ＃
	//ScrollBar ＃
	
	
	/** @List **/
	//ComboBox ＃
	//List ＃
	//DataGrid ＃
	//Tree ＃
	
	/** @Text **/
	//TextArea ＃
	//Window
	
	
	//Accordion ??
	//RadioButton ??
	//ColorChooser ??
	
	
	
	
	public static function startup():void
	{
		if (m_uiManager)
		{
			Logger.reportWarning('DespairUI', 'startup', 'despairUI has been started up !!')
		}
		
		m_uiManager = new UIManager()
	}
	
	
	public static function get pressedFusion():Fusion
	{
		return m_uiManager.pressedFusion
	}
	
	public static function get pressedPuppet() : IPuppet
	{
		return m_uiManager.pressedPuppet
	}
	
	public static function get overFusion() : Fusion
	{
		return m_uiManager.overFusion
	}
	
	public static function get overPuppet() : IPuppet
	{
		return m_uiManager.overPuppet
	}
	
	public static function get draggingObject() : IComponent
	{
		return m_uiManager.draggingObject
	}
	
	
	public static function get toolTip() : ToolTipManager
	{
		return m_toolTip ||= new ToolTipManager;
	}
	
	
	public static function stopDrag() : void
	{
		UIManager.stopDrag()
	}
	
	
	/**
	 * 生成
	 * @param	state
	 */
	public static function createPersona( stateData:*, layer:int = -1, forced:Boolean = true ) : Persona
	{
		return Persona.createPersona(stateData, layer, forced)
	}
	
	
	/**
	 * 查询
	 * @param	state
	 */
	public static function retrievePersona( state:* ) : Persona
	{
		return Persona.retrievePersona(state)
	}
	
	
	
	ns_despair static var m_toolTip:ToolTipManager;
	
	ns_despair static var m_uiManager:UIManager
	

}

}